<%@ page language="java" import="java.util.*" contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/meta.jsp" %>
<%@ page import="com.apache.uct.common.ToolsUtil" %>

<%
	String attachDomain = "";
	String attachServerUrl = "";
	
	attachDomain = ToolsUtil.getInstance().getValueByKey("DOMAIN");
	attachServerUrl =  ToolsUtil.getInstance().getValueByKey("atta_server");
%>

    <script type="text/javascript">
		var ctx = "<%=attachServerUrl%>";
		//document.domain = '<%=attachDomain%>';
		/*
	             无实体上传在网站或者其它外部系统使用时，需设置：
	     1.js中链接地址picStoreAction对象的参数isRemote=T
	     2.将本页面document.domain 的注释放开
	     3.在unity_config.properties中设置参数DOMAIN
		*/
	    myDis = function (id,flag,msg,murl){
	  	 alert(murl);
		};
	  
     </script>
     
	<%@ include file="/common/import.jsp" %>
	<!-- <link rel="stylesheet" type="text/css" href="${ctx}/js/easyui/themes/default/easyui.css"> -->
	<script type="text/javascript" src="${ctx}/js/easyui/extendvalidate.js"></script>
	<script type="text/javascript" src="${ctx}/js/attachment/js/singeAttrUpload-1.6.js"></script>
	<script type="text/javascript">
	function clickAttaSort(type){
	   window.location.href="${ctx}/attachment/media/toSample.action?type="+type;
	}
	</script>
	
<body  style="font-size:12px;font-family: 微软雅黑">
<span>				  
 <input type="radio" name="attaSort" value="0"  checked=checked onclick="clickAttaSort('0')" />&nbsp;附件
 <input type="radio" name="attaSort" value="2"   onclick="clickAttaSort('2')" />&nbsp;新附件上传
 <input type="radio" name="attaSort" value="1" onclick="clickAttaSort('1')" />&nbsp;图片
</span><br/><br/>	
 <div id="results"  title="" class="easyui-panel" style="height:450px;padding:5px;" >		
		<span>
			需要必要的dom环境：
			<p>需要引入easyui所需要的文件</p>
			<font color="blue">
			<xmp>
			<link rel="stylesheet" id="easyuicssId" type="text/css" href="http://atta.zbxdev.com/js/easyui/themes/default/easyui.css">
			<link rel="stylesheet" type="text/css" href="$http://atta.zbxdev.com/js/easyui/themes/icon.css">
			<script type="text/javascript" src="http://atta.zbxdev.com/js/easyui/jquery-1.8.0.js"></script>
			<script type="text/javascript" src="http://atta.zbxdev.com/js/easyui/jquery.easyui.min.js"></script>
			<script type="text/javascript" src="http://atta.zbxdev.com/js/easyui/locale/easyui-lang-zh_CN.js"></script>
			<script type="text/javascript" src="http://atta.zbxdev.com/js/easyui/extendvalidate.js"></script>
			</xmp>
			</font>
			
			<!-- <link rel="stylesheet" type="text/css" href="http://atta.zbxdev.com/js/jquery-easyui/themes/demo.css"> -->
		          功能实现者：
			<p>singeAttrUpload-1.6.js,在页面中引入此js文件</p>
			<font color="blue">
			<xmp>
     			<script type="text/javascript" src="${ctx}/js/attachment/js/singeAttrUpload-1.6.js"></script>
			</xmp>
			</font>
			<br>
			调用函数格式：<br>
			Supload(按钮id,接收图片文本框id,回调标记)
			<br>例如：
			<pre>
配置自调用myDis脚本（实现自我业务逻辑）
Supload('samupFileUpUrl','fileUpUrl','callbackFlag');
			</pre>
			<br>
		</span>
	</div>
</div>	<br/>
	例子：
	<!-- 
	<div id="loadImg">
		<img src="${ctx}/js/jquery-easyui/themes/default/images/pagination_loading.gif">	<font color="#827192">病毒扫描中,请稍后...</font>
	</div>
 -->
	<input type=text id="fileUpUrl" name="fileUpUrl"> 
	<a onclick="javascript:Supload('samupFileUpUrl','fileUpUrl');" 
						  id="samupFileUpUrl" class="easyui-linkbutton" iconCls="icon-add">上传附件</a>
	<br>
	<div style="padding-left:5px;">
		<font color="red">附件 code:</font>
		<br>
		<textarea rows="10" cols="100">
	    <input type=text id="fileUpUrl" name="fileUpUrl">
		<a onclick="javascript:Supload('samupFileUpUrl','fileUpUrl','myDis');" 
						id="samupFileUpUrl" class="easyui-linkbutton" iconCls="icon-add">上传附件</a>
		</textarea>
	</div>	

</body>
